# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test08
# Description:  跳出循环
# Author:       ASUS
# Date:         2019/1/17
#-------------------------------------------------------------------------------


x=0
while x<100:                         #开始while循环
    if x==5:                         #当x==5时终止循环
        break;
    print(x,end=" ")
    x+=1
print("\nbreak语句在for循环中的应用")
names=["Bill","Mike","Mary"]
for name in names:
    if not name.startswith("B"):
        break;
    print(name,end=" ")
print("\ncontinue语句在for循环中的应用")
for name in names:
    if name.startswith("B"):
        continue;
    print(name,end=" ")
print("\n嵌套循环")
arr1=[1,2,3,4,5]
arr2=["Bill","Mike","Mary"]
arr=[arr1,arr2]                    #定义一个二位列表变量
i=0
while i<len(arr):
    for value in arr[i]:
        print(value,end=" ")
    i+=1
    print()                        #换行



